package com.youhome.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.Date;

@Data
@ApiModel
@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
public class BShareGroupHouse {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "分享组ID")
    private String shareId;

    @ApiModelProperty(value = "房源ID")
    private String houseId;

    @ApiModelProperty(value = "创建时间")
    private Date ctime;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "图片")
    private String photo;

    @ApiModelProperty(value = "卧室数量")
    private Integer bedroomCount;

    @ApiModelProperty(value = "卫浴数量")
    private Integer bathroomCount;

    @ApiModelProperty(value = "价格")
    private Double listPrice;

    @ApiModelProperty(value = "销售类型")
    private String listingStatus;

    @ApiModelProperty(value = "房源类型")
    private String propertySubtype;

    public String getPhoto() {
        if (!StringUtils.isEmpty(photo)) {
            photo = "http://youhome-report.oss-cn-zhangjiakou.aliyuncs.com" + photo;
        }
        return photo;
    }
}